import request from '@/utils/request'

// 查询组和用户关系列表
export function listMembership(query) {
  return request({
    url: '/workflow/membership/list',
    method: 'get',
    params: query
  })
}

// 查询组和用户关系详细
export function getMembership(userId) {
  return request({
    url: '/workflow/membership/' + userId,
    method: 'get'
  })
}

// 新增组和用户关系
export function addMembership(data) {
  return request({
    url: '/workflow/membership',
    method: 'post',
    data: data
  })
}

// 修改组和用户关系
export function updateMembership(data) {
  return request({
    url: '/workflow/membership',
    method: 'put',
    data: data
  })
}

// 删除组和用户关系
export function delMembership(userId) {
  return request({
    url: '/workflow/membership/' + userId,
    method: 'delete'
  })
}

// 导出组和用户关系
export function exportMembership(query) {
  return request({
    url: '/workflow/membership/export',
    method: 'get',
    params: query
  })
}